package com.vgooo.client;

import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.List;

import android.app.Activity;
import android.app.Application;
import android.graphics.Bitmap;
import android.util.Log;

import com.vgooo.bean.IndexAdvInfo;
import com.vgooo.bean.NewsSimpleInfo;
import com.vgooo.bean.ProdInfo;
import com.vgooo.bean.UserInfo;
import com.vgooo.util.AsyncImageLoader;
import com.vgooo.util.BitmapUtils.BitmapRef;

public class VGApplication extends Application {
	private  List<NewsSimpleInfo> news ;
	public  List<IndexAdvInfo> advs;
//	public final  static HashMap<String,SoftReference<String>> jsonStringCaches = new HashMap<String, SoftReference<String>>();
	public final static ReferenceQueue<Bitmap> cachesRef = new ReferenceQueue<Bitmap>() ;
	public final static HashMap<String, BitmapRef> caches = new HashMap<String, BitmapRef>();// 图片软引用缓存集合
	public  static  String cachesPath ;//图片文件缓存路径
	public static List<ProdInfo> prods;//热门推荐手机信息
	public static UserInfo userInfo ;//用户信息
	public static String file ;
//	public static Activity  loadingActivity;//mainActivity ,
	public static boolean isDebug = true ;
	
	@Override
	public void onCreate() {
		// TODO Auto-generated method stub
		super.onCreate();
		
	}
	

	/**
	 * 获取位图内存软引用
	 * @return
	 */
	public static HashMap<String, BitmapRef> getCaches() {
		return caches;
	}
	/**
	 * 设置图片文件缓存路径
	 * @param cachesPath
	 */
	public void setCaesPath(String cachesPath){
		this.cachesPath = cachesPath ;
	}
	/**
	 * 獲取文件緩存路徑
	 * @return  cachesPath  
	 */
	public static String getCaesPath(){
		return cachesPath;
	}
	
	/**
	 * 打印调试信息
	 * 
	 * @param info
	 */
	private void log(String info) {
		Log.i(this.getClass().getSimpleName(), info);
	}

}
